const express = require("express");
const authRouter = express.Router();

authRouter.use((req, res, next) => {
  // 检查用户ID是否存在于会话中
  if (req.session.userId) {
    next();
  } else {
    res.status(401).send("请先登录");
  }
});


module.exports = authRouter;
